Class A3LMessaging


  • public class A3LMessaging
    extends java.lang.Object
    A3LMessaging class
    • Constructor Summary

      Constructors 
      Constructor Description
      A3LMessaging()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      com.amazon.device.messaging.ADM getADMInstance​(android.content.Context context)
      Gets instance of ADM, which can be used to call ADM methods directly
      static java.lang.String getCurrentPlatform​(android.content.Context context)
      Get current device platform
      com.google.firebase.messaging.FirebaseMessaging getFCMInstance()
      Gets instance of FirebaseMessaging, which can be used to call FCM methods directly
      static com.google.android.gms.tasks.Task<java.lang.String> getToken()
      Try to get the exiting device token, if one does not exists creates a new one.
      static void getToken​(android.content.Context context, OnInitCallback onInitCallback)
      Provides device registration token using callback method provided by developer
      static void init​(android.content.Context context, OnInitCallback onInitCallback)
      Deprecated.
      This method is deprecated, instead use getToken() method.
      static com.google.android.gms.tasks.Task<java.lang.Void> subscribeToTopic​(java.lang.String topic)
      Subscribes the app instance to the given topic.
      static com.google.android.gms.tasks.Task<java.lang.Void> unsubscribeFromTopic​(java.lang.String topic)
      Unsubscribes the app instance from the given topic.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • A3LMessaging

        public A3LMessaging()
    • Method Detail

      • init

        public static void init​(@NonNull
                                android.content.Context context,
                                OnInitCallback onInitCallback)
        Deprecated.
        This method is deprecated, instead use getToken() method. A3L initialization method. Should be called from onCreate activity of the app
        Parameters:
        context - : Application Context
        onInitCallback - : Option callback, which can be used to receive initialization status
      • getCurrentPlatform

        public static java.lang.String getCurrentPlatform​(@NonNull
                                                          android.content.Context context)
        Get current device platform
        Parameters:
        context - : Application Context
        Returns:
        Platform Constant Value e.g ADM_PLATFORM or FCM_PLATFORM
      • getToken

        public static void getToken​(@NonNull
                                    android.content.Context context,
                                    @NonNull
                                    OnInitCallback onInitCallback)
        Provides device registration token using callback method provided by developer
        Parameters:
        context - : Application Context
        onInitCallback - : Callback object which developer implements to process device registration token
      • getToken

        public static com.google.android.gms.tasks.Task<java.lang.String> getToken()
        Try to get the exiting device token, if one does not exists creates a new one.
        Returns:
        Task with token
      • subscribeToTopic

        public static com.google.android.gms.tasks.Task<java.lang.Void> subscribeToTopic​(@NonNull
                                                                                         java.lang.String topic)
        Subscribes the app instance to the given topic.
        Parameters:
        topic - : Topic to which the app instance is to be subscribed.
        Returns:
        Task which can be used by completion listener to determine whether the subscription completed.
      • unsubscribeFromTopic

        public static com.google.android.gms.tasks.Task<java.lang.Void> unsubscribeFromTopic​(@NonNull
                                                                                             java.lang.String topic)
        Unsubscribes the app instance from the given topic.
        Parameters:
        topic - : Topic from which the app instance is to be unsubscribed.
        Returns:
        Task which can be used by completion listener to determine whether the unsubscription completed.
      • getADMInstance

        public com.amazon.device.messaging.ADM getADMInstance​(@NonNull
                                                              android.content.Context context)
        Gets instance of ADM, which can be used to call ADM methods directly
        Parameters:
        context - : Application Context
        Returns:
        ADM: ADM instance
      • getFCMInstance

        public com.google.firebase.messaging.FirebaseMessaging getFCMInstance()
        Gets instance of FirebaseMessaging, which can be used to call FCM methods directly
        Returns:
        FirebaseMessaging: FirebaseMessaging Instance